package com.hfkh.keyun.controller.backend;

import com.hfkh.keyun.common.ApiResult;
import com.hfkh.keyun.entity.VisitHistory;
import com.hfkh.keyun.service.VisitHistoryService;
import com.hfkh.keyun.vo.VisitHistoryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/visitHistory")
@Api(tags = "历史记录管理")
public class VisitHistoryController {

    @Resource
    private VisitHistoryService visitHistoryService;
    @ApiOperation("修改历史列表")
    @PostMapping("/UpdateVisitHistory")
    public ApiResult UpdateVisitHistory(Integer id, VisitHistoryVo visitHistoryVo){
        System.out.println(visitHistoryVo.getVideoLocation());
        VisitHistory visitHistory=new VisitHistory();
        BeanUtils.copyProperties(visitHistoryVo,visitHistory);
        visitHistory.setId(id);
     visitHistoryService.updateById(visitHistory);
        return  ApiResult.success("修改历史记录");
    }


}
